<template>
    <div>
      <card-container  key="container3"  style="margin-top: 16px" :title="rightConTitle" >
        <answer-card v-if="rightList.length>0"  v-for="(val,index) in rightList" :key="val.questionId" :info="val"></answer-card>
        <empty-card v-if="rightList.length===0" height="556px"></empty-card>

      </card-container>
      <pagination key="container5" style="margin:20px auto;" :pages="pages" v-on:listenPageChange="changePage"></pagination>
    </div>
</template>

<script>
  import ProjectCard from '../../../components/pc/projectCard';
  import AnswerCard from '../../../components/pc/answerCard';
  import CardContainer from '../../../components/pc/cardContainer';
  import config from '../../../action/config';
  import Pagination from "../../../components/pc/pagination";
  import EmptyCard from "../../../components/pc/emptyCard";

  export default {

    name:'answer',
    data(){
      return{
        leftList:[],
        rightList:[],
        pages:1
      }
    },
    computed:{
      rightConTitle(){
            return '我回答的问题'

      },
    },
    components:{
      ProjectCard,CardContainer,AnswerCard,Pagination,EmptyCard
    },

    methods:{
      dataGetNoticeAnswer(currentPage){
        this.$axios.$get(config.api.get.Question.myParticipated,{
          params:{
            page:currentPage,
            size:10
          }
        }).then((response)=>{
          this.rightList  = response.data.dataList;
          this.pages = response.data.totalPage;
        })

      },

      changePage(currentPage){
        //返回页数 请求新的数据
        this.dataGetNoticeAnswer(currentPage);

      }


    },
  }
</script>

<style lang="scss">

</style>
